/**
 * 
 */
package com.miolr.module.core.api;

import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;

import org.hibernate.ObjectNotFoundException;

/**
 * @author iday
 * 
 */
@Provider
public class ObjectNotFoundMapper implements
		ExceptionMapper<ObjectNotFoundException> {

	@Override
	public Response toResponse(ObjectNotFoundException e) {
		return Response.status(Status.NOT_FOUND).entity(e.getMessage()).type("text/plain")
				.build();
	}

}
